package com.java.control.search;

import org.apache.commons.lang.StringUtils;

/**
 * 部门搜索
 * @author wqf
 * @version  Nov 24, 2011 11:55:45 AM
 */
public class DeptSearchCond extends SearchCond{
	
	private String deptName;
	
	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}
	
	public ConditionPart getCondition(){
		ConditionPart cp=new ConditionPart();
		StringBuffer searchStr=new StringBuffer(" 1=1");
		
		if(StringUtils.isNotBlank(deptName)){
			searchStr.append(" and deptName like ?");
			cp.getParams().add("%"+deptName.trim()+"%");
		}
		cp.setExpression(searchStr.toString());
		return cp;
	}

}
